<template>
  <div data-v-57cc3d0a="" class="setting" style="top: 0px">
    <div data-v-57cc3d0a="" class="setting-bg">
      <router-link to="/children/changephone">
        <div data-v-57cc3d0a="" class="setting-top">
          <span data-v-57cc3d0a="" class="left">修改绑定手机号码</span>
          <p data-v-57cc3d0a="">
            <span data-v-57cc3d0a="" class="right">{{
              $store.state.zlstore.userinfo.phone
            }}</span>
            <i
              data-v-57cc3d0a=""
              class="ydwiconfont iconwode-shezhi-jiantou"
            ></i>
          </p>
        </div>
      </router-link>
    </div>
    <div data-v-57cc3d0a="" class="setting-bg" @click="handleremove">
      <div data-v-57cc3d0a="" class="setting-top">
        <span data-v-57cc3d0a="" class="left">注销账号</span>
        <i data-v-57cc3d0a="" class="ydwiconfont iconwode-shezhi-jiantou"></i>
      </div>
    </div>
    <div data-v-57cc3d0a="" class="setting-bg" style="display: none">
      <div data-v-57cc3d0a="" class="setting-top">
        <span data-v-57cc3d0a="" class="left">实名认证</span>
        <i data-v-57cc3d0a="" class="ydwiconfont iconwode-shezhi-jiantou"></i>
      </div>
    </div>
  </div>
</template>

<script>
import { deleteuser } from "../../api/zl-goods";
export default {
  methods: {
    handleremove() {
      this.$dialog
        .confirm({
          message: "确定注销账号吗？",
        })
        .then(() => {
          // on confirm
          deleteuser(this.$store.state.zlstore.userinfo._id).then((res) => {
            if (res.data.code == 110) {
              this.$store.commit("zlstore/initusreinfoMut", null);
              this.$store.commit("pjcart/initSupplierList", []);
              this.$router.push("/");
            }
          });
        })
        .catch(() => {
          // on cancel
        });
    },
  },
};
</script>

<style lang="less" scoped>
</style>